{smcl}
{* 21 August 2008/26 August 2020}{...}
{cmd:help corrcii}{right:({browse "https://doi.org/10.1177/1536867X20976342":SJ20-4: pr0042_3})}
{hline}

{title:Title}

{p2colset 5 16 18 2}{...}
{p2col :{hi:corrcii} {hline 2}}Immediate form of correlation with confidence intervals{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 14 2}
{cmd:corrcii} 
{it:#n}
{it:#r}
[{cmd:,} 
{cmdab:l:evel(}{it:#}{cmd:)}
{opth fo:rmat(%fmt)} 
[{cmdab:fi:sher} | {cmdab:j:effreys}]]
 

{title:Description}

{p 4 4 2}{cmd:corrcii} calculates confidence intervals for Pearson
correlations using Fisher's {it:z} transform given a sample size of {it:#n} and
a sample correlation of {it:#r}.

{p 4 4 2}For sample size {it:n}, correlation {it:r}, and confidence level
{it:level}, the default procedure sets {it:d} = {cmd:invnormal(0.5 +}
{it:level}{cmd:/200)/sqrt(}{it:n} {cmd:- 3)} and {it:z} =
{cmd:atanh(}{it:r}{cmd:)} and then
calculates limits as {cmd:tanh(}{it:z} - {it:d}{cmd:)} and
{cmd:tanh(}{it:z} + {it:d}{cmd:)}.

{p 4 4 2}{cmd:corrcii} is an immediate command.  See {help immediate} for more
detail.


{title:Options}

{phang} {opt level(#)} specifies the confidence level, as a percentage, for
confidence intervals.  The default is {cmd:level(95)} or whatever is set by
{helpb set level}.

{p 4 8 2}{opt format(%fmt)} specifies a numeric format, {cmd:%}{it:fmt}, for
the display of correlations.  The default is {cmd:format(%9.3f)}.  See
{help format}.

{p 4 8 2}{cmd:fisher} specifies that a bias correction attributed to Fisher
(1921, 1925) be used.  This sets {it:z' = z} - {it:r}/[2 ({it:n} - 1)] and
then calculates limits as {cmd:tanh(}{it:z' - d}{cmd:)} and
{cmd:tanh(}{it:z'} + {it:d}{cmd:)}.  There is no consequence for the display
or saving of {it:r} itself.

{p 4 8 2}{cmd:jeffreys} specifies that a procedure attributed to Jeffreys
(1939, 1961) be used.  This sets {it:d} = {cmd:invnormal(0.5 +}
{it:level}{cmd:/200)/sqrt(}{it:n}{cmd:)} and {it:z}'' = {it:z} - 
5{it:r}/2{it:n} and then
calculates limits as {cmd:tanh(}{it:z'' - d}{cmd:)} and
{cmd:tanh(}{it:z''} + {it:d}{cmd:)}.  There is no consequence for the display
or saving of {it:r} itself.

{p 8 8 2}Only one of the {cmd:fisher} and {cmd:jeffreys} options can be
specified.


{title:Remarks}

{p 4 4 2}{cmd:corrcii} requires {it:n} to be at least 5.  With very small
samples--or even very large ones--interpretation remains the
user's responsibility.


{title:Examples}

{p 4 8 2}{cmd:. corrcii 78 0.946}{p_end}
{p 4 8 2}{cmd:. corrcii 78 0.946, level(99)}{p_end}
{p 4 8 2}{cmd:. corrcii 78 0.946, level(99) fisher}


{title:Stored results}

{pstd}
{cmd:corrcii} stores the following in {cmd:r()}:

{p 4}Scalars{p_end}
{col 7}{cmd:r(corr)} {col 15}scalar with correlation
{col 7}{cmd:r(lb)}   {col 15}scalar with lower limit
{col 7}{cmd:r(ub)}   {col 15}scalar with upper limit
{col 7}{cmd:r(z)}    {col 15}scalar with {it:z} = atanh {it:r}


{title:Author} 

{p 4 4 2}Nicholas J. Cox, Durham University, U.K.{break}
n.j.cox@durham.ac.uk


{title:Acknowledgments} 

{p 4 4 2}This project grew out of a question from Ian S. Evans.
Gleason's (1996) programs were an excellent source of ideas.


{title:References}

{p 4 8 2}Fisher, R. A. 1921. On the "probable error" of a coefficient of
correlation deduced from a small sample. {it:Metron} 1(4): 3-32.

{p 4 8 2}------. 1925. {browse "http://psychclassics.yorku.ca/Fisher/Methods/":{it:Statistical Methods for Research Workers}}.
Edinburgh: Oliver & Boyd.

{p 4 8 2}Gleason, J. R. 1996. Inference about correlations using the Fisher
z-transform. {browse "http://www.stata.com/products/stb/journals/stb32.pdf":{it:Stata Technical Bulletin 32}}: 13-18.
Reprinted in {browse "http://www.stata.com/bookstore/stbr.html":{it:Stata Technical Bulletin Reprints}}, vol. 6, pp. 128-129. College Station, TX: Stata Press.

{p 4 8 2}Jeffreys, H. 1939. {it:Theory of Probability.} Oxford: Oxford
University Press.

{p 4 8 2}------. 1961. {it:Theory of Probability.} 3rd ed. Oxford: Oxford
University Press.


{title:Also see}

{psee}
Article:  {it:Stata Journal}, volume 20, number 4: {browse "https://doi.org/10.1177/1536867X20976342":pr0041_3}{break}
         {it:Stata Journal}, volume 17, number 3: {browse "http://www.stata-journal.com/article.html?article=up0056":pr0041_2}{break}
         {it:Stata Journal}, volume 10, number 4: {browse "http://www.stata-journal.com/article.html?article=up0030":pr0041_1}{break}
         {it:Stata Journal}, volume 8, number 3: {browse "http://www.stata-journal.com/article.html?article=pr0041":pr0041}

{psee}
Manual:  {hi:[R] correlate}

{psee}
Online:  {helpb corrci} (if installed), {helpb correlate}, {helpb bootstrap}
{p_end}
